home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 326-350 / disk_339 / pcq / make.ced < prev    next >
Text File  |  1992-05-06  |  2KB  |  87 lines

  1. /* Make.CED
  2.     Passes the contents of the editor file into PIPE:, and
  3.     loads the compiler to compile it.  Then it calls the
  4.     assembler and linker. */
  5.  
  6. options results
  7.  
  8. 'status 21'
  9. filename = result
  10.  
  11. if lastpos('.',filename) = 0 then
  12.     OutFileName = ' T:' || filename || '.s'
  13. else
  14.     OutFileName = ' T:' || Left(filename, LastPos('.',filename) - 1) || '.s'
  15.  
  16. if open('InputFile', 'PIPE:' || filename, 'W') then do
  17.     Address command 'run >nil: <nil: Pascal >PIPE:PCQ.errors -q PIPE:' || filename || OutFileName
  18.     'status 17'
  19.     TotalLines = Result
  20.     do CurrentLine = 1 to TotalLines
  21.     'jumpto 'CurrentLine' 1'
  22.     'status 55'
  23.     dummy = writech('InputFile', Result)
  24.     end
  25.     Close('InputFile')
  26.     ErrorCount = 0
  27.     if Open('ErrorFile', 'PIPE:PCQ.errors', 'R') then do
  28.     ErrorMsg = ReadLn('ErrorFile')
  29.         do while ErrorMsg ~= ""
  30.             if ErrorMsg = "Compilation Aborted" then
  31.                 'okay1 'ErrorMsg
  32.             else do
  33.                 Parse var ErrorMsg 'Line ' LineNumber ' :' Description
  34.             'Jumpto 'LineNumber' 1'
  35.             'Okay1 'Description
  36.                 ErrorCount = ErrorCount + 1
  37.             end;
  38.         ErrorMsg = ReadLn('ErrorFile')
  39.         end;
  40.     Close('ErrorFile')
  41.     end; else do
  42.     'okay1 Could not open the Error File'
  43.     Exit
  44.     end
  45. end
  46.  
  47. if ErrorCount ~= 0 then do
  48.     'okay1 There were 'ErrorCount' errors'
  49.     Exit
  50. end;
  51.  
  52. InFileName = OutFileName
  53.  
  54. if lastpos('.',filename) = 0 then
  55.     OutFileName = filename || '.o'
  56. else
  57.     OutFileName = Left(filename, LastPos('.',filename) - 1) || '.o'
  58.  
  59. 'status 20'
  60.  
  61. OutFileName = Result || OutFileName /* add path information */
  62.  
  63. address command 'A68k 'InFileName' 'OutFileName
  64.  
  65. if Exists(OutFileName) then do
  66.  
  67.     Address command 'delete 'InFileName
  68.  
  69.     InFileName = OutFileName
  70.  
  71.     if lastpos('.',filename) = 0 then
  72.         OutFileName = filename
  73.     else
  74.         OutFileName = Left(filename, LastPos('.',filename) - 1)
  75.  
  76.     'status 20'
  77.     OutFileName = Result || OutFileName
  78.  
  79.     Address command 'Blink 'InFileName' to 'OutFileName' library PCQ.lib'
  80.  
  81.     if Exists(OutFileName) then
  82.         'okay1 'OutFileName' compiled and linked successfully'
  83.     else
  84.         'okay1 Could not link correctly'
  85. end; else
  86.     'Okay1 Could not assemble correctly'
  87.